package com.thinklab.view3g;

import android.app.Activity;
import android.os.Bundle;
import android.widget.RadioGroup;
import android.widget.RadioGroup.OnCheckedChangeListener;

public class SettingActivity extends Activity {
	V3Common mCommon;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.setting);
		mCommon = V3Common.getInstance(getApplicationContext());
		
		RadioGroup speedGroup = (RadioGroup) findViewById(R.id.refreshGrp);
		speedGroup.setOnCheckedChangeListener(new OnCheckedChangeListener() {
			public void onCheckedChanged(RadioGroup group, int checkedId) {
				if(checkedId == R.id.reffast){
					mCommon.set3GRefreshSpeed(10);
				}else if(checkedId == R.id.refnormal){
					mCommon.set3GRefreshSpeed(60);
				}else{
					mCommon.set3GRefreshSpeed(120);
				}
			}
		});
		
		int speed = mCommon.get3GRefreshSpeed();
		if(speed == 10){
			speedGroup.check(R.id.reffast);
		}else if(speed == 60){
			speedGroup.check(R.id.refnormal);
		}else{
			speedGroup.check(R.id.refslow);
		}
		
	}

}
